package com.d6game.web.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class JsonVO {
	private List<Map<String,Object>> list = new ArrayList<Map<String,Object>>();
	private int curIndex = 0;
	
	public JsonVO() {
	}
	public List<Map<String, Object>> getList() {
		return list;
	}

	public void setCurIndex(int index)
	{
		curIndex = index;
	}
	public void setValue(int i,String name,Object value)
	{
		Map<String,Object> map = null;
		if(i > (list.size()-1)){
			map = new HashMap<String,Object>();
			list.add(map);
		}
		else{
			map = list.get(i);
		}
		if(map == null){
			return;
		}
		map.put(name,value);
	}
	
	public void setValue(String name,Object value)
	{
		setValue(curIndex,name,value);
	}

}
